package com.jt.demo2.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Component
@Aspect
/**
 * spring中AOP如果多个环绕同通知参加，则采用嵌套结构
 * */
public class Aspct2 {
    @Around("@annotation(com.jt.demo2.anno.TX)")
    public Object around(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("环绕通知开始2");
        Object res = joinPoint.proceed();//
        System.out.println("环绕通知结束2");
        return res;
    }
}
